package com.eeepay.eeepay_v2.adapter;

import android.content.Context;
import android.view.View;

import com.eeepay.eeepay_v2.R;
import com.eeepay.v2_library.adapter.ABBaseAdapter;
import com.eeepay.v2_library.adapter.ABViewHolder;

/**
 * Created by zw on 2016/4/12 0012.
 */
public class AreaListAdapter extends ABBaseAdapter<String>{

    public AreaListAdapter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_area_list;
    }

    @Override
    public void convert(final ABViewHolder holder, String model) {
        holder.setText(R.id.tv_area_msg, model);
        holder.getView(R.id.tv_delete).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                int position = holder.getPosition();
                AreaListAdapter.this.remove(position);
            }
        });
    }
}
